Capturing multiple images over a plane orthogonal to the optical axis enables achieving complex effects using very simple operations like shifting and averaging.The goal of this project is to reproduce some of these effects using real lightfield data.
First, I took the image at (8, 8) to be the center image. Then I found the displacement between each image in the image set and the center image. For each image, I would shift it by (c * dx, c * dy), where c is some constant and dx, dy are displacements in the x and y direction, respectively. After shifting the images, I took their average and returned the resulting image.
The idea of this part is to refocus based on a subset of images, which are all within some radius of the center image. For example, if radius=2, the subset would be a 5x5 grind around the center image. To do this, I first created a 17x17 grid to assist with finding the nearest images. Then, I found the refocused image (with c=0.2 to focus on the center of the image) for each subset of images with integer radii in range [0, 9]. The results are shown below.
This project explores gradient-domain processing, a simple technique with a broad set of applications including blending, tone-mapping, and non-photorealistic rendering, specifically focusing on Poisson blending. The primary goal of this assignment is to seamlessly blend an object or texture from a source image into a target image.
For this part, we recover the original image using the minimization of v equation, listed on the project spec. I wrote each objective by following the hints in "Implementation Details", then using scipy.sparse.linalg.lsqr to solve for v. The results are shown below.
Original Image
Reconstructed Image
|
Original Image
Reconstructed Image
|
For this part, I used a similar approach as the toy problem, but tweaking the parameters and calculations a little (e.g. only calculating the part of image overlapping with the mask and expanding A and b four-fold because of the calculations on the 4-neighborhood). Also like the last part, I followed the "Implementation Details" of part 2.1 to find the objectives. This time, I would subtract the pixel from some coordinate (x,y) from its 4-neighborhood. I once again used scipy.sparse.linalg.lsqr to solve for v. Then, I transfered the pixels from v to my output image. The results are shown below. (Look! Oraple from project 2 is back!)
Background Image
Object Image
Mask
Blended Image
|
Background Image
Object Image
Mask
Blended Image
|
Background Image
Object Image
Mask
Blended Image
|
My implementation for mixed gradient blending was almost identical to my implementation of Poisson blending, except I set d_ij = t_i - t_j if t_i - t_j > s_i - s_j, where s is the source image and t is the target image.
Mixed Gradient Blend
Poisson Blend
|
Mixed Gradient Blend
Poisson Blend
|
Mixed Gradient Blend
Poisson Blend
|